package com.cyw.common.utils;


import com.cyw.common.bcrypt.BCryptPasswordEncoder;

public class BCryptUtils {
    public static BCryptPasswordEncoder ENCODER_INSTANCE = new BCryptPasswordEncoder();

    public static String encryptText(String text) {
        return ENCODER_INSTANCE.encode(text);
    }


    public static boolean matches(String rawPassword, String encodedPassword) {
        if (rawPassword == null || encodedPassword == null) return false;
        return ENCODER_INSTANCE.matches(rawPassword, encodedPassword);
    }
}
